@import './variables';

* {
  box-sizing: border-box;
  outline: none;
}

html {
  font-size: 13px;
}

body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background-color: #f1f1f1;
}

a {
  color: #999;
}

@each $colorKey,$color in $colors {
  .text-#{$colorKey} {
    color: $color;
  }
  .bg-#{$colorKey} {
    background-color: $color;
  }
}

// text
@each $var in (left, center, right) {
  .text-#{$var} {
    text-align: $var!important
  }
}

@each $sizeKey,$size in $font-sizes {
  .fz-#{$sizeKey} {
    font-size: $size * $base-font-size;
  }
}

// flex
.dp-flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-column {
  flex-direction: column;
}

@each $key,$value in $flex-jc {
  .jc-#{$key} {
    justify-content: $value;
  }
}

@each $key,$value in $flex-ai {
  .ai-#{$key} {
    align-items: $value;
  }
}

.flex-1 {
  flex: 1;
}

.flex-grow-1 {
  flex-grow: 1;
}


@each $typeKey,$type in $spacing-types {

  // m-1
  @each $sizeKey,$size in $spacing-sizes {
    .#{$typeKey}-#{$sizeKey} {
      #{$type}: $size * $spacing-base-size
    }
  }

  // mx-1
  @each $sizeKey,$size in $spacing-sizes {
    .#{$typeKey}x-#{$sizeKey} {
      #{$type}-left: $size * $spacing-base-size;
      #{$type}-right: $size * $spacing-base-size
    }
  }

  @each $sizeKey,$size in $spacing-sizes {
    .#{$typeKey}y-#{$sizeKey} {
      #{$type}-top: $size * $spacing-base-size;
      #{$type}-bottom: $size * $spacing-base-size
    }
  }

  // mt-1
  @each $drKey,$dr in $spacing-directions {
    @each $sizeKey,$size in $spacing-sizes {
      .#{$typeKey}#{$drKey}-#{$sizeKey} {
        #{$type}-#{$dr}: $size * $spacing-base-size
      }
    }
  }
}

// button
.btn {
  border: none;
  border-radius: 0.1538rem;
  font-size: map-get($font-sizes, 'sm' ) * $base-font-size;
  padding: .2rem .6rem;
}

// nav
.nav {
  display: flex;
  justify-content: space-between;
  background-color: map-get($colors, 'white');
  color: map-get($colors, 'black');
  
  .nav-item {
    border-bottom: 2px solid transparent;
    padding-bottom: .2rem;
    &.active {
      color: map-get($colors, 'primary');
      border-bottom-color: map-get($colors, 'primary');
    }
  }
  &.nav-inverse {
    background-color: map-get($colors, 'primary');
    color: map-get($colors, 'white');
    .nav-item {
      border-bottom: 2px solid transparent;
      padding-bottom: .2rem;
      &.active {
        color: map-get($colors, 'white');
        border-bottom-color: map-get($colors, 'white');
      }
    }
  }
}


// width, height 
.w-100 {
  width: 100%;
}
.h-100 {
  height: 100%;
}

// sprite
.sprite {
  background: url('~@/assets/img/sprite.png') no-repeat 0 0;
  background-size: 28.8462rem;
  background-position: 63.546% 15.517%;
  display: inline-block;
  height: 1.5385rem;
  width: 1.7692rem;
  &.sprite-arrow {
    background-position: 38.577% 52.076%;
    width: 0.7692rem;
	  height: 0.7692rem;
  }
  
}

// text ellipsis
.text-ellipsis {
  overflow: hidden;
  text-overflow:ellipsis;
  white-space: nowrap;
}